package com.taotao.html.controller;

import com.taotao.common.pojo.TaotaoResult;
import com.taotao.html.service.ContentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * Created by Administrator on 2017/7/16.
 */
@Controller
public class IndexController {

    @Autowired
    private ContentService service;

    @RequestMapping("/index")
    public String showIndex(Model model) {
        String adJson = service.getContentList();
        model.addAttribute("ad1", adJson);
        return "index";
    }


    @RequestMapping(value = "/httpclient/post",method = RequestMethod.POST)
    @ResponseBody
    public TaotaoResult testPost(String username,String password) {
        System.out.println(username+"---"+password);
        return TaotaoResult.ok();
    }


}
